{$CLEO .cS}
0000: 
thread 'rollercoaster'

const
   Train = 1@
   Selected_train = 2@ 
   direction_set = 3@ 
   MENU_PANEL = 4@
   MENU_PANEL_PICK_NUMBER = 5@ 
   SPEED = 6@ 
   Thread_running = 6@ 
   STOP_STATION = 7@ 
   Random_trains = 8@ 
   Ride_over = 9@ 
end
0A95: save_this_custom_script
 
   SPEED = 0.0 
   STOP_STATION = 0
#STREAKC.Load 
#STREAK.Load 
#TRAM.Load 
#FREIGHT.Load 
#FREIFLAT.Load 
#FREIBOX.Load 
038B: load_requested_models

06D8: Train = create_train_at   -1686.2709 446.4458 29.7091 type 8 direction 0
CAR.Health(Train)= 900000000000
09CF: set_train Train stop_at_stations 0
06DD: set_train Train   SPEED
06DC: set_train Train acc SPEED
MARKER.CreateAboveCar(30@,Train)
018B: set_marker 30@ radar_mode 2
marker.SetColor(30@, 3)
Ride_over = true

32@ = 77777 //STOP DEFAULT 
while true 
wait 0
gosub @Getout 
if is_car_defined  Train
then
06DD: set_train Train the_speed  SPEED
06DC: set_train Train acc SPEED
end
if and
89DE: not  actor $PLAYER_ACTOR entering_car 
not actor.Driving($PLAYER_ACTOR)
00E1:   player 0 pressed_key 15
00FE:   actor $PLAYER_ACTOR sphere 1 in_sphere  -1701.605 444.4423 29.5109 radius 3.0 3.0 3.0
then
        if    
        Ride_over == true
        then
            if is_car_defined  Train
            then
               0407: store_coords_to 20@ 21@ 22@  from_car Train with_offset 1.0 0.0 -1.0
               06A7: put_actor $PLAYER_ACTOR into_turret_on_car Train at_car_offset 1.0 -0.5 0.0 position 0 shooting_angle 0.0 360.0 with_weapon 0
               if coop
               then
               06A7: put_actor player2 into_turret_on_car Train at_car_offset -1.0 -0.5 0.0 position 0 shooting_angle 0.0 360.0 with_weapon 0
        
               end 
               Ride_over = false 
               0679: put_camera_on_car Train with_offset 0.0 7.0 1.0  rotation 0.0 180.0 0.0 tilt 0.0 switchstyle 2

               speed = 10.0         // Start the train
               32@ = 0 
            
            06D7: enable_train_traffic 0
               
            end
        
        else
               show_styled_text "~w~WAIT TIL THE ROLLERCOASTER COMES DOWN! DUMMY!" 3000 5
        
        end
end   

//RIDE A TRAIN! 
   if  and
   Ride_over == false
   is_car_defined  Train
   then
            //START
        if  01AF:   car Train sphere 0 in_sphere -1700.2643 459.2352 30.6423  radius 3.0 3.0 3.0
        then
           speed = 10.0
        end
        if  01AF:   car Train sphere 0 in_sphere -1684.6119 585.6503 137.7098  radius 3.0 3.0 3.0
        then
           speed = 8.0
        end
        if  01AF:   car Train sphere 0 in_sphere  -1544.4557 586.7494 246.965 radius 3.0 3.0 4.0
        then
           speed = 5.0
        end
        if  01AF:   car Train sphere 0 in_sphere  -1519.9257 587.7227 232.2234 radius 3.0 3.0 3.0
        then
           speed = 60.0
        end
        if  01AF:   car Train sphere 0 in_sphere -1489.0511 578.8843 151.1479  radius 3.0 3.0 3.0
        then
           speed = 80.0
        end
        if  01AF:   car Train sphere 0 in_sphere  -1549.5533 460.6617 192.4717 radius 3.0 3.0 3.0
        then
           speed = 90.0
        end
        if  01AF:   car Train sphere 0 in_sphere -1812.1199 459.944 203.4717  radius 3.0 3.0 3.0
        then
           speed = 80.0
        end
        if  01AF:   car Train sphere 0 in_sphere -1827.2488 477.1655 249.4717  radius 3.0 3.0 3.0
        then
           speed =   80.0
        end
        if  01AF:   car Train sphere 0 in_sphere -1825.6567 592.4334 245.6828  radius 3.0 3.0 3.0
        then
           speed = 70.0
        end
        if  01AF:   car Train sphere 0 in_sphere  -1806.3684 606.3896 197.7838 radius 3.0 3.0 3.0
        then
           speed =  120.0
        end
        if  01AF:   car Train sphere 0 in_sphere  -1569.0887 604.3148 128.0126 radius 3.0 3.0 3.0
        then
           speed =  140.0
        end
        if  01AF:   car Train sphere 0 in_sphere  -1566.2598 470.8395 135.5312 radius 3.0 3.0 4.0
        then
           speed =  110.0
        end
        if  01AF:   car Train sphere 0 in_sphere  -1636.0798 469.6277 202.2792 radius 3.0 3.0 4.0
        then
           speed = 80.0
        end
        if  01AF:   car Train sphere 0 in_sphere  -1702.4607 470.5119 249.9117 radius 3.0 3.0 4.0
        then
           speed = 60.0
        end
        if  01AF:   car Train sphere 0 in_sphere -1804.0232 473.0738 183.7612  radius 3.0 3.0 4.0
        then
           speed = 120.0 
        end
        if  01AF:   car Train sphere 0 in_sphere  -1761.1273 596.6105 228.1655 radius 3.0 3.0 4.0
        then
           speed = 100.0
        end
        if  01AF:   car Train sphere 0 in_sphere -1675.2468 597.0083 300.1655  radius 3.0 3.0 4.0
        then
           speed = 90.0 
        end
        if  01AF:   car Train sphere 0 in_sphere -1593.4594 596.164 290.2534  radius 3.0 3.0 4.0
        then
           speed =  120.0
        end
        if  01AF:   car Train sphere 0 in_sphere  -1503.2458 595.371 171.1847 radius 3.0 3.0 4.0
        then
           speed =  150.0
        end
        
        //TIME TO SLOW FROM START
        if  01AF:   car Train sphere 0 in_sphere  -1512.1587 446.844 29.6931 radius 3.0 3.0 4.0
        then
           speed = 100.0
        end
        if  01AF:   car Train sphere 0 in_sphere -1552.1025 446.313 29.7182 radius 3.0 3.0 4.0
        then
           speed = 60.0
        end
        if  01AF:   car Train sphere 0 in_sphere -1622.7225 446.5741 29.6911  radius 3.0 3.0 4.0
        then
           speed = 30.0
        end
        if  01AF:   car Train sphere 0 in_sphere -1662.9869 446.6516 29.6818  radius 3.0 3.0 4.0
        then
           speed = 15.0
           Ride_over = true
        end 
   end
   if and
   32@ > 5000
   Ride_over == TRUE
   is_car_defined  Train
   then
        if  01AF:   car Train sphere 0 in_sphere  -1686.2709 446.4458 29.7091  radius 3.0 3.0 4.0
        then
           speed = 0.0 
           IF 0A32:  actor $PLAYER_ACTOR on_turret_of_car
           THEN
             0465: remove_actor $PLAYER_ACTOR from_turret_mode
             ACTOR.PutAt(PLAYER1, -1683.3907, 440.8872, 29.5109)
             ACTOR.Angle(PLAYER1)=187.2455

              CAMERA.Restore_WithJumpCut()   
            END    
             if coop
             then
                IF  0A32:  actor player2 on_turret_of_car
                THEN
                     0465: remove_actor player2 from_turret_mode
                     ACTOR.PutAt(PLAYER2,-1681.0613, 439.928, 29.5109 )
                     ACTOR.Angle(PLAYER2)=179.7186
                END
             end            
            
            06D7: enable_train_traffic 1
              
        end    
     
   end
end 

:Getout 
 if test_cheat  "RELOAD"                                                  
 then
           IF 0A32:  actor $PLAYER_ACTOR on_turret_of_car
           THEN
             0465: remove_actor $PLAYER_ACTOR from_turret_mode
             ACTOR.PutAt(PLAYER1, -1683.3907, 440.8872, 29.5109)
             ACTOR.Angle(PLAYER1)=187.2455

              CAMERA.Restore_WithJumpCut()   
            END    
             if coop
             then
                IF  0A32:  actor player2 on_turret_of_car
                THEN
                     0465: remove_actor player2 from_turret_mode
                     ACTOR.PutAt(PLAYER2,-1681.0613, 439.928, 29.5109 )
                     ACTOR.Angle(PLAYER2)=179.7186
                END
             end               
     show_styled_text "ROLLERCOASTER RESETED" 3000 5
     CAMERA.Restore_WithJumpCut() 
     06D7: enable_train_traffic 1
     0A92: stream_custom_script "!@Alien Rollercoaster.cs" 
     end_thread 
 end 


return 